/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.dao.hibernate;

import com.click.app.dao.PaymentsPantDao;
import com.click.app.model.Employee;
import com.click.app.model.PaymentsPant;
import java.util.Date;
import java.util.List;

/**
 *
 * @author ariel
 */
public class PaymentsPantDaoHibernate extends GenericDaoHibernate<PaymentsPant, Long> implements PaymentsPantDao{

    public PaymentsPantDaoHibernate() {
        super(PaymentsPant.class);
    }

    public List<PaymentsPant> findByDate(Date date) {
        return getHibernateTemplate().find("from PaymentsPant where datePay=?", date);
    }

    public List<PaymentsPant> findByEmployeePeriod(Employee employee, Date initDate, Date endDate) {
        Object[] objects = {employee, initDate, endDate};
        return getHibernateTemplate().find("from PaymentsPant where periodPaymentEmployee.employee=? and datePay Between ? And ? order by datePay", objects);
    }
}
